package test;

import expression.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Chris Meyers
 */
public class ChrisMeyersIPTest {
        
    @Before
    public void setUp() {
    }

    @Test
    public void testOne() {
        //multiple spaces are intentional
        String answer1 = InfixtoPostfixTranslator.eval("(       ( 7 / ( 3 + 4    ) ) + 5     )");
        assertEquals(answer1, "7 3 4 + / 5 +");
    }
    
    @Test
    public void testTwo() {
        String answer2 = InfixtoPostfixTranslator.eval("( ( 4 ^ 2 ) * 3 + 1 )");
        assertEquals(answer2, "4 2 ^ 3 * 1 +");
    }
        
    @Test
    public void testThree() {
        String answer3 = InfixtoPostfixTranslator.eval("( 54 - 3 + ( 8 / 3 ) * 2 )");
        assertEquals(answer3, "54 3 - 8 3 / 2 * +");
    }
            
    @Test
    public void testFour() {
        String answer4 = InfixtoPostfixTranslator.eval("( ( 5 - ( ( 3 * 2 ) / 4 ) ) + 17 )");
        assertEquals(answer4, "5 3 2 * 4 / - 17 +");
    }
                
    @Test
    public void testFive() {
        String answer5 = InfixtoPostfixTranslator.eval("( ( 2 ^ 2 ) + ( ( 16 / 4 ) * 2 ) )");
        assertEquals(answer5, "2 2 ^ 16 4 / 2 * +");
    }
}
